//
//  UIBarButtonItem+Extension.swift
//  Weibo
//
//  Created by Holfioo on 15/9/10.
//  Copyright © 2015年 Holfioo. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    // 便利构造函数
    convenience init(imageName: String, target: AnyObject?, actName: String? ) {
        let btn = UIButton(imageName: imageName)
        
        if target != nil && actName != nil {
            btn.addTarget(target, action: Selector(actName!), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView: btn)
    }
}